]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Add open method to FolderIcon
authorRay Strode <rstrode@redhat.com>
Thu, 18 Jul 2019 14:19:13 +0000 (10:19 -0400)
committerRay Strode <halfline@gmail.com>
Tue, 23 Jul 2019 14:53:24 +0000 (14:53 +0000)
At the moment the only way to open a folder icon is to click on it;
there's no API to open the icon programmatically.

This commits adds an open method and makes the click handler use
it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628

js/ui/appDisplay.js

index d361ec16c133a1417033d597350a9b08e2e02d97..30d565bc1ed05d033fa1d51cc9fdbe64b93bcf21 100644 (file)
@@ -1137,11 +1137,7 @@ var FolderIcon = class FolderIcon {
 
         this.view = new FolderView();
 
-        this.actor.connect('clicked', () => {
-            this._ensurePopup();
-            this.view.actor.vscroll.adjustment.value = 0;
-            this._openSpaceForPopup();
-        });
+        this.actor.connect('clicked', this.open.bind(this));
         this.actor.connect('destroy', this.onDestroy.bind(this));
         this.actor.connect('notify::mapped', () => {
             if (!this.actor.mapped && this._popup)
@@ -1164,6 +1160,12 @@ var FolderIcon = class FolderIcon {
             this._popup.actor.destroy();
     }
 
+    open() {
+        this._ensurePopup();
+        this.view.actor.vscroll.adjustment.value = 0;
+        this._openSpaceForPopup();
+    }
+
     getAppIds() {
         return this.view.getAllItems().map(item => item.id);
     }